using System.Collections.Generic;
using UnityEngine;

public class CameraChangeButton : MonoBehaviour
{
	public TTCameraController cameraController;

	public UILabel label;

	private void Awake()
	{
		SetCameraView(GGPlayerSettings.instance.Model.usedCameraView);
	}

	private void SetCameraView(int usedCameraView)
	{
		List<CameraBehavioursDB.CameraGroupType> list = CameraBehavioursDB.instance.UsedCameraGroupTypes();
		GGPlayerSettings instance = GGPlayerSettings.instance;
		usedCameraView %= list.Count;
		CameraBehavioursDB.CameraGroupType newGroup = list[usedCameraView];
		cameraController.ChangeCameraGroup(newGroup);
		instance.Model.usedCameraView = usedCameraView;
		instance.Save();
		label.text = newGroup.ToString();
	}

	public void OnClick()
	{
		SetCameraView(GGPlayerSettings.instance.Model.usedCameraView + 1);
	}
}
